package cn.com.huzo.model.entities.trade;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 销售发票主记录实体类
 *
 * @author 吴旭
 */
public class CommercialInvoiceHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -1209106534914427760L;
    private Long HeaderId;
    private Long Messrs;                      // 购货单位（买家）
    private String MessrsName;
    private String MotorVessel;               // 机动船运输(shipped per s.s,意思是用蒸汽动力船运输 s.s是steamer ship的缩写)
    private String InvoiceNo;                 // 发票号
    private String NoOfContract;              // 合同号
    private String PortOfShipment;            // 起运港
    private Timestamp DateOfShipment;         // 起运日期
    private String PortOfDestination;         // 到达港
    private Timestamp DateOfInvoice;          // 开票日期
    private Long ModeOfSettlementId;          // 支付方式 
    private String ModeOfSettlementName;
    private Integer TotalCaseQuantity;        // 总箱数
    private Float GrossWeight;                // 毛重
    private Float NetWeight;                  // 净重
    private Float Cubage;                     // 体积
    private String Description1;              // 备注1
    private String Description2;              // 备注2
    private String Description3;              // 备注3
    private String Description4;              // 备注4

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public Long getMessrs() {
        return Messrs;
    }

    public void setMessrs(Long Messrs) {
        this.Messrs = Messrs;
    }

    public String getMessrsName() {
        return MessrsName;
    }

    public void setMessrsName(String MessrsName) {
        this.MessrsName = MessrsName;
    }

    public String getMotorVessel() {
        return MotorVessel;
    }

    public void setMotorVessel(String MotorVessel) {
        this.MotorVessel = MotorVessel;
    }

    public String getInvoiceNo() {
        return InvoiceNo;
    }

    public void setInvoiceNo(String InvoiceNo) {
        this.InvoiceNo = InvoiceNo;
    }

    public String getNoOfContract() {
        return NoOfContract;
    }

    public void setNoOfContract(String NoOfContract) {
        this.NoOfContract = NoOfContract;
    }

    public String getPortOfShipment() {
        return PortOfShipment;
    }

    public void setPortOfShipment(String PortOfShipment) {
        this.PortOfShipment = PortOfShipment;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfShipment() {
        return DateOfShipment;
    }

    public void setDateOfShipment(Timestamp DateOfShipment) {
        this.DateOfShipment = DateOfShipment;
    }

    public String getPortOfDestination() {
        return PortOfDestination;
    }

    public void setPortOfDestination(String PortOfDestination) {
        this.PortOfDestination = PortOfDestination;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfInvoice() {
        return DateOfInvoice;
    }

    public void setDateOfInvoice(Timestamp DateOfInvoice) {
        this.DateOfInvoice = DateOfInvoice;
    }

    public Long getModeOfSettlementId() {
        return ModeOfSettlementId;
    }

    public void setModeOfSettlementId(Long ModeOfSettlementId) {
        this.ModeOfSettlementId = ModeOfSettlementId;
    }

    public String getModeOfSettlementName() {
        return ModeOfSettlementName;
    }

    public void setModeOfSettlementName(String ModeOfSettlementName) {
        this.ModeOfSettlementName = ModeOfSettlementName;
    }

    public Integer getTotalCaseQuantity() {
        return TotalCaseQuantity;
    }

    public void setTotalCaseQuantity(Integer TotalCaseQuantity) {
        this.TotalCaseQuantity = TotalCaseQuantity;
    }

    public Float getGrossWeight() {
        return GrossWeight;
    }

    public void setGrossWeight(Float GrossWeight) {
        this.GrossWeight = GrossWeight;
    }

    public Float getNetWeight() {
        return NetWeight;
    }

    public void setNetWeight(Float NetWeight) {
        this.NetWeight = NetWeight;
    }

    public Float getCubage() {
        return Cubage;
    }

    public void setCubage(Float Cubage) {
        this.Cubage = Cubage;
    }

    public String getDescription1() {
        return Description1;
    }

    public void setDescription1(String Description1) {
        this.Description1 = Description1;
    }

    public String getDescription2() {
        return Description2;
    }

    public void setDescription2(String Description2) {
        this.Description2 = Description2;
    }

    public String getDescription3() {
        return Description3;
    }

    public void setDescription3(String Description3) {
        this.Description3 = Description3;
    }

    public String getDescription4() {
        return Description4;
    }

    public void setDescription4(String Description4) {
        this.Description4 = Description4;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof CommercialInvoiceHeaderEntity)) {
            return false;
        }

        final CommercialInvoiceHeaderEntity that = (CommercialInvoiceHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
